<template>
	<view>
		<web-view :src="isHttp(parms.url)"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				parms: {}
			}
		},
		onLoad(e) {
			if (e.url) {
				this.parms = e
			} else {
				this.$common.errorToShow('参数异常')
			}
		},
		methods: {
			isHttp(url) {
				console.log(url)
				var pattern = /^(?:https?:\/\/)?([\w.-]+(?:\.[\w.-]+)+)\b(?:\/|$)/;
				if (pattern.test(url)) {
					return this.$options.filters.filterHttp(url)
				} else {
					// this.$common.errorToShow('url参数异常')
				}
			}
		}
	}
</script>

<style>

</style>